%%% LaTeX definitions for JPC 2006
%%%


\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{jpc}[2006/02/08]

\usepackage{geometry}
\geometry{a4paper,left=2.5cm,top=2.5cm}

\setlength \textwidth{16cm}
\setlength \textheight{23.5cm}

% font
\RequirePackage{times}

\renewcommand{\normalsize}{\@setfontsize\normalsize\@xiipt\@xivpt}
\renewcommand{\footnotesize}{\@setfontsize\footnotesize{10}{14}}
\newcommand{\XIIPT}{\@setfontsize\xiipt{12}{16}}
\newcommand{\XIVPT}{\@setfontsize\xivpt{14}{18}}

% Affiliation commands 
\newcounter{instn}
\setcounter{instn}{1}
\newcommand{\instnum}{\arabic{instn}}
\newcommand{\inst}[1]{\ensuremath{^#1}}
\newcommand{\nextinstitution}{\\\mbox{}\\[-6pt] \addtocounter{instn}{1}\inst{\instnum}}
\newcommand{\email}[1]{\\\mbox{}\\[-6pt]\footnotesize\texttt{#1}}


% itens
\setlength\leftmargini   {2.5cm}
\setlength\leftmargin    {\leftmargini}
\setlength\leftmarginii  {\leftmargini}
\setlength\leftmarginiii {\leftmargini}
\setlength\leftmarginiv  {\leftmargini}
\setlength  \labelsep    {.5em}
\setlength  \labelwidth  {\leftmargini}
\addtolength\labelwidth  {-\labelsep}
\def\@listI{\leftmargin\leftmargini
            \parsep 0\p@ \@plus1\p@ \@minus\p@
            \topsep 0\p@ \@plus2\p@ \@minus4\p@
            \itemsep0\p@}
\let\@listi\@listI
\@listi
\def\@listii {\leftmargin\leftmarginii
              \labelwidth\leftmarginii
              \advance\labelwidth-\labelsep
              \topsep    0\p@ \@plus2\p@ \@minus\p@}
\def\@listiii{\leftmargin\leftmarginiii
              \labelwidth\leftmarginiii
              \advance\labelwidth-\labelsep
              \topsep    0\p@ \@plus\p@\@minus\p@
              \parsep    \z@
              \partopsep \p@ \@plus\z@ \@minus\p@}

% first-order section
\renewcommand\section{\@startsection
  {section}
  {1}
  {0pt}
  {\baselineskip}
  {\baselineskip}
  {\normalfont\XIIPT\bfseries}}

% second order section
\renewcommand\subsection{\@startsection
  {subsection}
  {2}
  {0pt}
  {\baselineskip}
  {\baselineskip}
  {\normalfont\XIIPT\bfseries}}

% third-order section
\renewcommand\subsubsection{\@startsection
  {subsubsection}
  {3}
  {0pt}
  {\baselineskip}
  {-.5cm}
  {\normalfont\XIIPT\bfseries}}

\RequirePackage{indentfirst}

\RequirePackage{titlesec}
\titlelabel{\thetitle.\hspace{1ex}}


% first page
\let\ps@plain=\ps@empty % no page numbering
\pagestyle{empty}

\newcommand{\authortag}[1]{$^{#1}$}

\def\address#1{\gdef\@address{#1}}

\def\@maketitle{\newpage
 \begin{center}
   \vglue -6pt
   \vspace*{12pt}
  {\XIVPT\bf\@title\par}
   \vglue 18pt plus 3pt minus 3pt
  {\normalsize
  \begin{tabular}[t]{c}\@author\end{tabular}\par}
   \vglue 6pt plus 3pt minus 3pt
  {\normalsize
   \begin{tabular}[t]{c}\inst{\instnum}\@address\end{tabular}\par}
   \vglue 18pt plus 3pt minus 3pt
   \end{center}\par
}

% abstract definition
\renewenvironment{abstract} {
\footnotesize

 \begin{center}%
    {\bfseries \abstractname\vspace{-.5em}\vspace{\z@}}%
  \end{center}%
  \list{}{
    \leftmargin=0cm
    \listparindent=1em
    \itemindent    \listparindent 
    \rightmargin \leftmargin   
    \parsep        \z@ \@plus\p@}%
\item   \itshape}
{\endlist}

